package com.project.dao.implement;

import org.apache.ibatis.session.SqlSession;

import com.project.dao.AccountTreeSubMenuMapper;
import com.project.utils.SessionFactoryGen;
import java.util.List;

public class AccountTreeSubMenuImpl implements AccountTreeSubMenuMapper{
	@Override
	public List<String> GetUserAccountList(String bankName)
	{
		List<String>  result= null;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountTreeSubMenuMapper mapper =  sqlSession.getMapper(AccountTreeSubMenuMapper.class);
			  result = (List<String>)mapper.GetUserAccountList(bankName);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public List<String> GetUserAccountListByOtherBank()
	{
		List<String>  result= null;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountTreeSubMenuMapper mapper =  sqlSession.getMapper(AccountTreeSubMenuMapper.class);
			  result = (List<String>)mapper.GetUserAccountListByOtherBank();
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
}
